package com.song.day02固定解码器.server;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.DefaultFileRegion;
import io.netty.channel.FileRegion;
import io.netty.handler.timeout.IdleState;
import io.netty.handler.timeout.IdleStateEvent;

import java.io.File;
import java.io.RandomAccessFile;

//SimpleChannelInboundHandler<PackageMessage>
public class ServerHandler  extends  ChannelInboundHandlerAdapter{

	
	public void channelRead(ChannelHandlerContext ctx, Object obj)
			throws Exception {
		
		System.out.println("receive client : [" +obj +" ]");
	}


	@Override
	public void channelReadComplete(ChannelHandlerContext ctx) {
		ctx.flush();
	}

	@Override
	public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
		System.out.println(cause.getCause());
		ctx.close();
	}


}
